<template>
    <div>
        <input 
            type="number"
            placeholder="请输入手机号"  
            :value="phoneInfo.phone" 
            @input="handlePhoneChange" 
        />

        <input 
            type="number"
            placeholder="请输入邮编"  
            :value="zipCode" 
            @input="handleZipCodeChange" 
        />
    </div>
</template>

<script>
    export default {
        name: 'PersonnelInfo',
        model: {
            prop: 'phoneInfo',
            event: 'change'   // model自定义的事件,默认是input
        },
        props: {
            phoneInfo: Object,
            zipCode: String
        },
        methods: {
           handlePhoneChange(e) {
               this.$emit('change',{
                   ...this.phoneInfo,
                   phone:e.target.value
               });
           },
           handleZipCodeChange(e) {
               this.$emit('update:zipCode',e.target.value);
           }
        }
    }
</script>